<?php 
/**
 * MobileAlliance
 * ========================================================
 * Copy 2010-2012 iswu
 * Web:http://sirius.ccaeo.com
 * ========================================================
 * Author:iswu
 * Date:${date}
 */
session_start();
//防止恶意调用
//定义常量，用来授权调用includes里面的文件
define('IN_TG', true); 

//定义一个常量，用来指定本页的内容
define('SCRIPT', 'about');

//引入公共文件
// require 'includes/common.inc.php';   // 相对路径引入的文件不够快
require dirname(__FILE__).'/includes/common.inc.php'; //转换成绝对路径引入的速度会更快

// echo PHP_VERSION; // php版本号

//登录状态
_login_state();
global $_system;

/*
// echo microtime(); //微秒数  时间戳
$_mtime = explode(' ', microtime());
// print_r($_mtime);//打印数组
$_start_time = $_mtime[1] + $_mtime[0];//加载开始时间
//通过for循环语句增加程序的时间复杂度
// for ($i = 0; $i < 100000; $i++){}
usleep(1000000);//睡眠函数
*/

//判断是否提交了  建议使用get表单可以在URL后面看到action＝register
if($_GET['action'] == 'index'){
    if (!empty($_system['index'])) {
        exit('禁止非法提交！');
    }

    /*
    echo '你提交了数据';
    exit();
    */
    /*
    //为了防止恶意注册和跨站攻击
    if($_POST['yzm'] == $_SESSION['code']){
        
        //接受username
        $_username = $_POST['username'];
        echo $_username;
        
    }else{
        _alert_back('验证码不正确!');
    }
    */
    
    //为了防止恶意注册和跨站攻击
    /*
    if($_POST['code'] != $_SESSION['code']){
        _alert_back('验证码不正确!');
    }
    */
    //_check_code($_POST['code'], $_SESSION['code']);
    
    /*
    //接受username,$_POST['username']是受污染的数据(外部不可信任的数据,没有过滤的数据)
    $_username = $_POST['username'];
    $_password = $_POST['password'];
    $_notpassword = $_POST['notpassword'];
    
    echo $_username;
    echo $_password;
    echo $_notpassword;*/
    
    //引入验证文件
    include ROOT_PATH.'includes/check.inc.php';
    //创建一个数组，用来存放提交过来的合法数据
    $_clean = array();
    
    //可以通过唯一标识符来防止恶意注册，伪装表单跨站攻击等
    //这个存放入数据库的唯一标识符还有第二个用途：登录cookies验证
    $_clean['uniqid'] = _check_uniqid($_POST['uniqid'], $_SESSION['uniqid']);
    //激活用户  active也是唯一标识符，用来刚注册的用户进行激活处理，方可登录
    $_clean['active'] = _sha1_uniqid();
    //头尾的空格必须去掉
    $_clean['name'] = _check_name($_POST['name'], 2, 20);
    $_clean['phone'] = _check_phone($_POST['phone'], 11);
    $_clean['class'] = _check_class($_POST['class'], 10, 20);
    $_clean['message'] = _check_message($_POST['message'], 10, 40);
    //print_r($_clean);

    /*
    //在新增之前，要判断用户名是否重复
    //$query = mysql_query("SELECT tg_username FROM tg_user WHERE tg_username='{$_clean['username']}'") or die ('SQL错误！');
    $query = _query("SELECT tg_username FROM tg_user WHERE tg_username='{$_clean['username']}'");
    if(mysql_fetch_array($query,MYSQL_ASSOC)){
        _alert_back('对不起，此用户已被注册！');
    }
    */

    /*
    if (_fetch_array("SELECT tg_username FROM tg_user WHERE tg_username='{$_clean['username']}'")) {
        _alert_back('对不起，此用户已被注册！');
    }
    */
    /*
    _is_repeat(
        "SELECT tg_username FROM tg_user WHERE tg_username='{$_clean['username']}'LIMIT 1",
        '对不起，此用户已被注册！'
        );
	*/
    //新增用户
    //测试新增，看看能否成功
    //在双引号里，直接放变量是可以的，比如$_username，但如果是数组，就必须加上{},比如{$_clean['username']}
    /*
    mysql_query("
        INSERT INTO tg_user (
                             tg_uniqid,
                             tg_active,
                             tg_username,
                             tg_password,
                             tg_question,
                             tg_answer,
                             tg_sex,tg_face,
                             tg_email,
                             tg_qq,
                             tg_url,
                             tg_reg_time,
                             tg_last_time,
                             tg_last_ip
                             ) 
        VALUES (
                '{$_clean['uniqid']}',
                '{$_clean['active']}',
                '{$_clean['username']}',
                '{$_clean['password']}',
                '{$_clean['question']}',
                '{$_clean['answer']}',
                '{$_clean['sex']}',
                '{$_clean['face']}',
                '{$_clean['email']}',
                '{$_clean['qq']}',
                '{$_clean['url']}',
                NOW(),
                NOW(),
                '{$_SERVER["REMOTE_ADDR"]}')
                ") or die ('SQL执行失败！'. mysql_error());
    */

    _query("
        INSERT INTO tg_user (
                             tg_uniqid,
                             tg_active,
                             tg_name,
                             tg_phone,
                             tg_class,
                             tg_message
                             ) 
        VALUES (
                '{$_clean['uniqid']}',
                '{$_clean['active']}',
                '{$_clean['name']}',
                '{$_clean['phone']}',
                '{$_clean['class']}',
                '{$_clean['message']}')
                ");
    /*
    //关闭数据库
    //mysql_close();
    _close();

    //跳转
    _location('恭喜你，注册成功！', 'index.php');
    */
    if (_affected_rows() == 1) {

        //获取刚刚新增的ID
        $_clean['id'] = _insert_id();

        _close();  //执行_close();后没办法执行mysql函数
        // _location('恭喜你，注册成功！'._affected_rows(), 'active.php');
        // _session_destroy();

        //生成XML
        _set_xml('new.html', $_clean);

        _location('恭喜你，提交成功！', 'about.php?active='.$_clean['active']);
    } else {
        _close();
        // _session_destroy();
        _location('很遗憾，提交失败！', 'about.php');
    }
}
/*
//判断是否提交成功 post表单URL后面看不到action
if($_POST['action'] == 'register'){
    echo '你提交了数据';
    exit();
}
*/
/*
echo strlen('bb');       2
echo strlen('版本');      6
echo mb_strlen('版本', 'utf-8');      2*/

/*
//转义字符
echo addslashes("This's a Teacher!");//This\'s a Teacher!
echo mysql_escape_string("This's a Teacher!");//This\'s a Teacher!
echo mysql_real_escape_string("This's a Teacher!");//This\'s a Teacher!
*/

/*
echo md5('123456');   //32位密码加密
echo sha1('123456');   //40位密码加密
*/

/*
//自动转义
echo mysql_real_escape_string('i a"m a student!');
*/

/*
//get_magic_quotes_gpc();on off 默认是开启的，如果想关掉，必须在php.ini关闭它
echo get_magic_quotes_gpc();
*/

//echo md5(uniqid(rand(), true/false));
//sha1(uniqid(rand(), true));叫做唯一标识符,每台电脑都会产生不相同的唯一标识符
else{
$_SESSION['uniqid'] = $_uniqid = _sha1_uniqid();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>移动联盟协会-About</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="移动联盟协会，致力于移动开发，主要研究方向：移动互联网开发，包括基于html5微网站开发、安卓app移动应用等。协会旨在创立成为一个开源、技术分享、学术交流的群体，定期会开展顺应时代潮流的技术培训，培养应用型人才。" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->
<link href="css/style.css" rel='stylesheet' type='text/css' />	
<script src="js/jquery.min.js"> </script>
<script src="js/bootstrap.min.js"></script>
<!--webfonts-->
  <link href='http://fonts.useso.com/css?family=PT+Mono|Abril+Fatface' rel='stylesheet' type='text/css'>
<!--//webfonts-->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<!--/script-->
<script type="text/javascript">
			jQuery(document).ready(function($) {
				$(".scroll").click(function(event){		
					event.preventDefault();
					$('html,body').animate({scrollTop:$(this.hash).offset().top},900);
				});
			});
</script>

</head>
<body>
	<!--start-header-->
			<div id="home" class="header two">
					<div class="top-header">
						<div class="container">
					     <div class="top-menu">
							<span class="menu"> </span>
								<ul class="cl-effect-16">
								 <li><a href="index.php" data-hover="Home">Home</a></li>
								 <li><a class="active" href="about.php" data-hover="About">About</a></li>
								 <li><a  href="typography.php" data-hover="Department">Department</a></li>
								 <li><a href="gallery.php" data-hover="Gallery">Gallery</a></li>
								 <li><a href="blog.php" data-hover="blog">Blog</a></li>
								 <li><a href="contact.php" data-hover="Contact">Contact</a></li>
								  <div class="clearfix"></div>
								</ul>
							</div>
							<div class="logo two">
							  <a href="index.php"><h1>移动<span>联盟</span></h1></a>
						    </div>
							<!-- script-for-menu -->
								<script>
									$("span.menu").click(function(){
										$(".top-menu ul").slideToggle("slow" , function(){
										});
									});
								</script>
								<!-- script-for-menu -->
							<div class="clearfix"> </div>
					</div>
				</div>
			</div>
		<!--//end-slider-->
	<!--start-about-->
	<div class="about two">
		<div class="container">
		 <h3 class="tittle">About Us</h3>
				<div class="about-top">
					<div class="col-md-7 about-top-right">
						<h4 style="font-size:24px">移动开发也称为手机开发，或叫做移动互联网开发。是指以手机、PDA、UMPC等便携终端为基础，进行相应的开发工作，由于这些随身设备基本都采用无线上网的方式，因此，业内也称作为无线开发。</h4>
						<p style="font-size:16px">移动应用开发是为小型、无线计算设备编写软件的流程和程序的集合，像智能手机或者平板电脑。移动应用开发类似于Web应用开发，起源于更为传统的软件开发。但关键的不同在于移动应用通常利用一个具体移动设备提供的独特性能编写软件。例如，利用iPhone的加速器编写游戏应用。</p>
						<p style="font-size:16px">4G时代，手机为王</p>
						<p style="font-size:16px">4G时代的到来，使得手机应用日渐热门，由于手机携带方便，并且是生活必带随身用品，而且信号覆盖广，操作便捷，使得人们对其给予了越来越高的期望。大家期待各种常见的或是重要的信息化系统、互联网应用可以被移植到手机上同步使用，使用户无论在何时何地，都可以连线精彩的网络世界，登录信息系统。为此，如何进行手机开发，如何在手机上催生各种多姿多彩的精彩应用，日渐成为整个ICT产业关注的焦点。</p>
					</div>
					<div class="col-md-5 about-top-left">
						<img src="images/ab.jpg" class="img-responsive" alt=""/>
					</div>
					<div class="clearfix"></div>
				</div>
			</div>	 
	</div>
	<!--start-team-->
		<div class="team">
	      <div class="container">
			 <h3 class="tittle">Our Team</h3>
			<div class="main">

				<div class="col-md-3 view fifth-effect">
					 <a href="#" title="Full Image"><img src="images/t1.jpg" /></a>
					 <div class="mask"></div>
				</div>     
				
				<div class="col-md-3 view fifth-effect">
					 <a href="#" title="Full Image"><img src="images/t2.jpg" /></a>
					 <div class="mask"></div>
				</div>     
				
				<div class="col-md-3  view fifth-effect">
					 <a href="#" title="Full Image"><img src="images/t3.jpg" /></a>
					 <div class="mask"></div>
				</div>     
				
				<div class="col-md-3 view fifth-effect">
					 <a href="#" title="Full Image"><img src="images/t4.jpg" /></a>
					 <div class="mask"></div>
				</div>                
				<div class="clearfix"></div>
			</div>

		  </div>
       </div>
	<!--//team-->
	<div class="testimonials">	
	  <div class="container">
	   <h3 class="tittle two">Presidium</h3>
		<div  id="top" class="callbacks_container">
					<ul class="rslides" id="slider3">
						<li>
							<div class="testi-text">
								<div class="col-md-3 testi-img">
									<img src="images/c2.jpg" alt=""/>
								</div>
								<div class="col-md-9 tt-text">
									<h4>沈运武</h4>
									<p>现任移动联盟协会会长。曾获：2014-2015学年上学期优秀学生二等奖学金；2015-2016学年上学期优秀学生三等奖学金；策划书制作大赛一等奖；网页设计大赛二等奖；ACM程序设计大赛优胜奖；“优秀学生，优秀班干部”等荣誉称号。</p>				
								</div>
									 <div class="clearfix"> </div>			
							</div>
						</li>
						<li>
							<div class="testi-text">
								<div class="col-md-3 testi-img">
									<img src="images/c1.jpg" alt=""/>
								</div>
								<div class="col-md-9 tt-text">
									<h4>肖显代</h4>
									<p>现任移动联盟协会副会长。</p>				
								</div>
									 <div class="clearfix"> </div>			
							</div>
						</li>
						<li>
							<div class="testi-text">
								<div class="col-md-3 testi-img">
									<img src="images/c3.jpg" alt=""/>
								</div>
								<div class="col-md-9 tt-text">
									<h4>曾治宾</h4>
									<p>现任移动联盟协会副会长。</p>				
								</div>
									 <div class="clearfix"> </div>			
							</div>
						</li>
					</ul>
				</div>
		</div>
	</div>
	<!-- banner-text Slider starts Here -->
		<script src="js/responsiveslides.min.js"></script>
		<script>
			// You can also use "$(window).load(function() {"
				$(function () {
				// Slideshow 3
					$("#slider3").responsiveSlides({
					auto: true,
					pager:true,
					nav:false,
					speed: 500,
					namespace: "callbacks",
					before: function () {
					$('.events').append("<li>before event fired.</li>");
					},
					after: function () {
						$('.events').append("<li>after event fired.</li>");
					}
				});	
			});
		</script>

	 <!--start-mid-section-->
     <div class="mid-section">
	    <div class="container">
		     <div class="mid-top">
		        <h2>A brief introduction to the tutor.</h2>
				<p>韩迪（Andy Ham），澳门科技大学计算机专业博士生，香港理工大学助理研究员，高校教师。拥有超过十年的软件开发经验。较早的Android开发实践者之一，对Android和移动开发有深入的研究。技术精通：Java、Web前端等开发语言，研究方向：移动互联网、普适计算。曾出版有关网络和移动开发多本畅销书.</p>
		     </div>
		</div>
	</div>
	 <!--/contact-->
	<div class="contact">
			<div class="contact-map">
				<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d10015.498657932954!2d-0.1570060357124469!3d51.129219866008135!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4875f1c859d0e855%3A0xb0ce82410da5809!2sA2011%2C+Crawley%2C+West+Sussex+RH10%2C+UK!5e0!3m2!1sen!2sin!4v1409743498026" frameborder="0" style="border:0"></iframe>
				<div class="contact-form">
					<div class="contact-head">
						<h4>Contact</h4>
					 </div>
					<form name = "index" method = "post" action="index.php?action=index"> 
						<input type = "hidden" name = "uniqid" value = "<?php echo $_uniqid?>" />
					     <input type="text" class="text" value="Name" name="name" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = '';}">
						 <input type="text" class="text" value="Phone Number" name="phone" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Email Address';}">
						<input type="text" class="text" value="class" name="class" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Subject';}">
						<textarea value="Message" name="message" onFocus="this.value = '';" onBlur="if (this.value == '') {this.value = 'Message';}">Message</textarea>
						<div class="clearfix"> </div>
						<div class="sub-button">
							<input name="submit" type="submit" value="Send ">
						</div>
					</form>
				</div>
			</div>
		</div>
		<!--footer-->
			<div class="footer">
				<div class="container">
					<div class="copy">
		              <p>Copyright &copy; 2015.Company name All rights reserved.</p>
		            </div>
					
				</div>
			</div>
				<!--start-smoth-scrolling-->
						<script type="text/javascript">
									$(document).ready(function() {
										/*
										var defaults = {
								  			containerID: 'toTop', // fading element id
											containerHoverID: 'toTopHover', // fading element hover id
											scrollSpeed: 1200,
											easingType: 'linear' 
								 		};
										*/
										
										$().UItoTop({ easingType: 'easeOutQuart' });
										
									});
								</script>
		<a href="#home" id="toTop" class="scroll" style="display: block;"> <span id="toTopHover" style="opacity: 1;"> </span></a>


</body>
</html>